package com.zillion.web.controller.employ;

import com.zillion.common.core.controller.BaseController;
import com.zillion.common.core.domain.AjaxResult;
import com.zillion.employee.service.IPersonApplyService;
import com.zillion.health.domain.HealthPersonInfo;
import com.zillion.health.domain.vo.UISelectDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 从业人员个人上报处理
 *
 * @author zillion
 */
@RestController
@RequestMapping("/employee/personApply")
public class PersonApplyController extends BaseController {

    @Autowired
    private IPersonApplyService personApplyService;

    /**
     * 新增个人申报信息
     */
//    @Log(title = "新增人员信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody HealthPersonInfo healthPersonInfo) {
        return toAjax(personApplyService.insertHealthPersonApply(healthPersonInfo));
    }

    /**
     * 查询56个名族基础数据
     */
    @GetMapping("/listEthnic")
    public List<UISelectDataVo> listEthnic() {
        return personApplyService.listEthnic();
    }

    /**
     * 加载园区下拉框选项
     */
    @GetMapping("/listParkId")
    public List<UISelectDataVo> listParkId() {
        return personApplyService.listParkId();
    }

    /**
     * 加载工种下拉框选项
     */
    @GetMapping("/listJobTypes")
    public List<UISelectDataVo> listJobTypes() {
        return personApplyService.listJobTypes();
    }

}
